package cate.common.table.activity.godequip.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.godequip.row.GodEquipScoreRow;

import java.util.List;
import java.util.OptionalInt;
import java.util.stream.Collectors;

public class GodEquipScoreSheet extends ESheet<GodEquipScoreRow> {
    @Override
    public String getSheetName() {
        return "神装寻宝幸运值";
    }

    public List<GodEquipScoreRow> getRowsByGroup(int group) {
        return getList().stream().filter(row -> row.group == group).collect(Collectors.toList());
    }

    public int getMaxTimesByGroup(int group) {
        OptionalInt max = getList().stream().filter(row -> row.group == group).mapToInt(row -> row.luckyLimit).max();
        return max.orElse(0);
    }
}
